package com.ar.webSimple.action;

import java.io.Serializable;

import javax.annotation.PostConstruct;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;

import org.springframework.context.ApplicationContext;

import com.ar.webSimple.myContext.MyContext;
import com.ar.webSimple.servicios.ProductoService;
import com.ar.webSimple.utils.Constantes;

@ManagedBean(name="demo")
@ApplicationScoped
public class DemoAction implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 7002367495344504433L;
	private ApplicationContext context;
	private ProductoService productoService;
	private String saluda;

	@PostConstruct
	private void init(){
		context =  MyContext.getApplicationContext();
		productoService = (ProductoService) context.getBean("productoService");
	}
	
	public String demo(){
		return "ok";
	}
	

	public String getSaluda() {
		return saluda;
	}

	public void setSaluda(String saluda) {
		this.saluda = saluda;
	}
	
}
